ACTOR Schism_Pistol : Schism_BaseWeapon
{
	Weapon.AmmoType1 "BDPistolAmmo"
	Weapon.AmmoGive1 0
	Weapon.AmmoUse1 1
	Weapon.AmmoType2 "Clip1"
	Weapon.AmmoGive2 0
	Weapon.AmmoUse2 0
	Weapon.SelectionOrder 2300
	Weapon.PreferredSkin "Pistol Marine"
	+WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOALERT
	+WEAPON.NO_AUTO_SWITCH
	+WEAPON.WIMPY_WEAPON
	+WEAPON.AMMO_OPTIONAL
	Obituary "%o was shot down by %k's pistol."
    Inventory.Pickupmessage "$GOTPISTOL"
    Inventory.PickupSound "CLIPIN"
	Inventory.ForbiddenTo Paladin, Corvus
	AttackSound "None"
	Tag "Pistol"
	Scale 0.9
	States
	{
		Spawn:
			PIST G -1
			Stop
		
		Select:
			TNT1 A 0 A_Raise	
			Wait

		Deselect:
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG D 0 
			"####" ABCDE 1
			"####" E 0 A_JumpIfInventory("Zoomed", 1, "Deselect2")
			DeselectLoop:
			TNT1 A 0 A_Lower
			Wait
		
		Deselect2:
			TNT1 A 0 A_TakeInventory("Zoomed", 1)
			Deselect2Loop:
			TNT1 A 0 A_ZoomFactor(1.0)
			TNT1 A 0 A_Lower
			Loop
				
		Ready:	
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" EDCBA 1
			ReadyLoop:
			TNT1 A 0 A_JumpIfNoAmmo("NoAmmo2")
			MPIS F 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			PIST F 0
			"####" "#" 0 A_JumpIfInventory("Zoomed", 1, "ReadyInZoom")
			"####" "#" 0 A_SetCrosshair(0)
			"####" "#" 0 A_JumpIfInventory("Kicking", 1, "DoKick")	
			"####" "#" 0 A_JumpIfInventory("Taunting", 1, "Taunt")	
			"####" "#" 0 A_JumpIfInventory("Reloading", 1, "Reload")	
			"####" "#" 0 A_JumpIfInventory("TossGrenade", 1, "TossGrenade")	
			"####" "#" 0 A_JumpIfInventory("Quickspell", 1, "Quickspell")
			"####" "#" 0 A_JumpIfInventory("StartDualWield", 1, "DualWield")
			"####" "#" 0 A_JumpIfInventory("GoFatality", 1, "Steady")
			"####" F 1 A_WeaponReady(WRF_ALLOWRELOAD)
			Loop
		
		ReadyInZoom:
			BESZ A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERZ A 0
			"####" "#" 0 A_JumpIfInventory("Kicking", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("Taunting", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("Reloading", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("TossGrenade", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("Quickspell", 1, "ExitFromZoom")
			"####" "#" 0 A_JumpIfInventory("StartDualWield", 1, "ExitFromZoom")
			"####" D 1 A_WeaponReady(WRF_ALLOWRELOAD)
			Loop
		
		Fire:
			TNT1 A 0 A_JumpIfNoAmmo("NoAmmo")
			TNT1 A 0 A_JumpIfInventory("Zoomed", 1, "FireInZoom")
			MPIS A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			PIST A 0
			"####" "#" 0 A_JumpIfInventory("FrostEnchantedBrutalPistol", 1, 2)
			"####" "#" 0 A_AlertMonsters
			"####" "#" 0 A_PlaySound("PFIRE", CHAN_WEAPON)
			"####" "#" 0 A_Takeinventory("BDDualPistolAmmo", 1)
			Goto CheckForFireType
			CheckForFireType:
			"####" "#" 0 A_JumpIfInventory("FireEnchantedBrutalPistol", 1, "FireEnchanchment")
			"####" "#" 0 A_JumpIfInventory("LightningEnchantedBrutalPistol", 1, "ElEnchanchment")
			"####" "#" 0 A_JumpIfInventory("FrostEnchantedBrutalPistol", 1, "FrostEnchanchment")
			Goto NormalFire
			FireEnchanchment:
			"####" A 1 Bright A_FireBullets(1, 1, 1, 18, "FirePuff", FBF_NORANDOM | FBF_USEAMMO)
			Goto EndOfFire
			ElEnchanchment:
			"####" A 1 Bright A_FireBullets(1, 1, 1, 26, "TeslaPuff", FBF_NORANDOM  | FBF_USEAMMO)
			Goto EndOfFire
			FrostEnchanchment:
			"####" A 1 Bright A_FireBullets(1, 1, 1, 22, "FrostPuff", FBF_NORANDOM | FBF_USEAMMO)
			Goto EndOfFire
			NormalFire:
			"####" A 1 Bright A_FireBullets(1, 1, 1, 10, "WeakPuff", FBF_NORANDOM | FBF_USEAMMO)
			EndOfFire:
			"####" "#" 0 A_FireCustomMissile("DecorativeTracer", random(-1, 1), 0, 0, 0)
			
			"####" B 1
			"####" F 0 A_FireCustomMissile("PistolCaseSpawn",5,0,0,-9)
			"####" C 0 A_JumpIfInventory("BDPistolAmmo", 1,3)
			"####" B 0 A_JumpIfInventory("IsSorcerer",1,2)
			"####" C 0
			
			"####" "#" 1 
			"####" D 0 A_JumpIfInventory("BDPistolAmmo", 1,3)
			"####" B 0 A_JumpIfInventory("IsSorcerer",1,2) 
			"####" C 0
			
			"####" "#" 1 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
			"####" F 0 A_JumpIfInventory("Reloading",1,"Reload")
			"####" F 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
			"####" A 0 A_JumpIfInventory("Quickspell",1,"Quickspell")
			"####" F 0 A_JumpIfInventory("BDPistolAmmo", 1, 3)
			"####" B 0 A_JumpIfInventory("IsSorcerer",1,2) 
			"####" C 0
			
			"####" "#" 2 A_WeaponReady(WRF_NOBOB | WRF_ALLOWRELOAD)
			Goto ReadyLoop
			
		FireInZoom:
			BESZ A 0 A_JumpIfInventory("BDPistolAmmo", 1, 1)
			Goto NoAmmoInZoom
			BESZ A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERZ A 0
			"####" "#" 0 A_AlertMonsters
			"####" "#" 0 A_PlaySound("PFIRE", CHAN_WEAPON)
			"####" "#" 0 A_TakeInventory("BDDualPistolAmmo", 1)
			"####" "#" 0 A_TakeInventory("BDPistolAmmo", 1)
			"####" "#" 0 A_FireCustomMissile("PistolCaseSpawn", 5, 0, 6, -2)
			CheckForFireTypeInZoom:
			"####" "#" 0 A_JumpIfInventory("FireEnchantedBrutalPistol", 1, "FireEnchanchmentInZoom")
			"####" "#" 0 A_JumpIfInventory("LightningEnchantedBrutalPistol", 1, "ElEnchanchmentInZoom")
			"####" "#" 0 A_JumpIfInventory("FrostEnchantedBrutalPistol", 1, "FrostEnchanchmentInZoom")
			Goto NormalFireInzoom
			FireEnchanchmentInZoom:
			"####" E 1 Bright A_FireBullets(1, 1, 1, 20, "FirePuff", FBF_NORANDOM)
			Goto EndOfFireInZoom
			ElEnchanchmentInZoom:
			"####" E 1 Bright A_FireBullets(0, 0, 1, 26, "TeslaPuff", FBF_NORANDOM)
			Goto EndOfFire
			FrostEnchanchmentInZoom:
			"####" E 1 Bright A_FireBullets(0, 0, 1, 22, "FrostPuff", FBF_NORANDOM)
			Goto EndOfFireInZoom
			NormalFireInZoom:
			"####" E 1 Bright A_FireBullets(0, 0, 1, 16, "WeakPuff", FBF_NORANDOM)
			EndOfFireInZoom:
			"####" "#" 0 A_FireCustomMissile("DecorativeTracer", random(-1, 1), 0, 0, 0)
			"####" F 1 Bright A_SetPitch(Pitch - 0.5)
			"####" G 1 A_SetPitch(Pitch + 0.1)
			"####" H 1 A_WeaponReady
			"####" I 1 A_WeaponReady
			"####" "#" 0 //A_JumpIfInventory("FiredPrimary", 1, "Fire")
			"####" "#" 0 A_JumpIfInventory("FiredSecondary", 1, "ADSMode")
			"####" "#" 0 A_JumpIfINventory("ZoomHold", 1, "ExitFromZoom")
			Goto ReadyLoop
			
		AltFire:
		Zoom:
			BESZ A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERZ A 0
			"####" "#" 0 A_SetCrosshair(41)
			"####" "#" 0 A_GiveInventory("GoSpecial", 1)
			"####" "#" 0 A_JumpIfInventory("Zoomed", 1, "ExitFromZoom")
			"####" "#" 0 A_GiveInventory("Zoomed", 1)
			"####" "#" 0 A_ZoomFactor(1.5)
			"####" "#" 0 A_GiveInventory("ADSmode", 1)
			"####" ABC 1
			"####" "#" 0 A_JumpIfInventory("FiredPrimary", 1, "Fire")
			"####" "#" 0 A_JumpIfInventory("Reloading", 1, "ExitFromZoom")
			"####" D 7 A_WeaponReady
			"####" "#" 0 A_JumpIfInventory("FiredSecondary", 1, "ADSMode")
			Goto ReadyLoop
		
		ADSMode:
			BESZ A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERZ A 0
			"####" "#" 0 A_GiveInventory("ZoomHold", 1)
			"####" "#" 0 A_JumpIfInventory("FiredPrimary", 1, "Fire")
			"####" "#" 0 A_JumpIfInventory("Reloading", 1, "ExitFromZoom")
			"####" D 1 A_WeaponReady(WRF_ALLOWRELOAD)
			"####" "#" 0 A_JumpIfInventory("FiredSecondary", 1, "ADSMode")
			Goto ExitFromZoom
		
		ExitFromZoom:
			"####" "#" 0 A_TakeInventory("Zoomed", 1)
			"####" "#" 0 A_TakeInventory("ZoomHold", 1)
			"####" "#" 0 A_TakeInventory("ADSmode", 1)
			"####" "#" 0 A_ZoomFactor(1.0)
			"####" DCBA 1
			Goto ReadyLoop
		
		Reload:
			MPIR A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BRER A 0
			"####" "#" 0 A_TakeInventory("Reloading", 1)
			"####" "#" 0 A_Takeinventory("Zoomed", 1)
			"####" "#" 0 A_TakeInventory("ADSmode", 1)
			"####" "#" 0 A_ZoomFactor(1.0)
			"####" "#" 0 A_JumpIfInventory("BDPistolAmmo", 16, "ReadyLoop")
			"####" "#" 0 A_JumpIfInventory("Clip1", 1, 1)
			Goto ReadyLoop
			"####" F 0 A_JumpIfInventory("TurboReload", 1, "RefillTo15")
			"####" "#" 0 A_JumpIfInventory("BDPistolAmmo", 1, "ReloadNotEmpty")
			"####" C 0 A_FireCustomMissile("EmptyClipSpawn", -5, 0, 8, -4)
			"####" F 0 A_PlaySound("prel2", 1)
			"####" AA 0
			"####" ZY 2
			"####" ABCDE 1
			"####" FFFFFFFF 1
			"####" GGHIJ 1
			"####" KLMNOQP 1
			Goto RefillTo15
			
		ReloadNotEmpty:
			MBRR A 0 A_JumpIfInventory("IsSorcerer",1,2)
			BR2R A 0
			"####" F 0 A_PlaySound("prel")
			"####" AA 0
			MPIR A 0 A_JumpIfInventory("IsSorcerer",1,2)
			BRER A 0
			"####" ZY 2
			MBRR A 0 A_JumpIfInventory("IsSorcerer",1,2)
			BR2R A 0
			"####" ABCDEFFFFFFFFFGHIJKL 1
			MPIR A 0 A_JumpIfInventory("IsSorcerer",1,2)
			BRER A 0
			"####" MNOP 2
			"####" F 0 A_Takeinventory("HasUnloaded",1)
			Goto Refillto16
			
		RefillTo15:
			"####" F 0 A_GiveInventory("BDPistolAmmo", 1)
			"####" F 0 A_GiveInventory("BDDualPistolAmmo", 1)
			"####" F 0 A_TakeInventory("Clip1", 1)
			"####" F 0 A_JumpIfInventory("BDPistolAmmo", 15, "ReadyLoop")
			"####" F 0 A_JumpIfInventory("Clip1", 1, "RefillTo15")
			Goto ReadyLoop
			
		RefillTo16:
			"####" F 0 A_GiveInventory("BDPistolAmmo", 1)
			"####" F 0 A_GiveInventory("BDDualPistolAmmo", 1)
			"####" F 0 A_TakeInventory("Clip1", 1)
			"####" F 0 A_JumpIfInventory("BDPistolAmmo", 16, "ReadyLoop")
			"####" F 0 A_JumpIfInventory("Clip1", 1, "RefillTo16")
			Goto ReadyLoop
			
		Steady:
			TNT1 A 1
			Goto ReadyLoop
			
		DoKick:
			"####" "#" 0 A_GunFlash("KickFlash")
			"####" "#" 0 A_TakeInventory("Kicking", 1)
			"####" "#" 0 A_Takeinventory("Zoomed", 1)
			"####" "#" 0 A_Takeinventory("PowerLightAmp", 1)
			"####" "#" 0 A_ZoomFactor(1.0)
			"####" "#" 0 A_Takeinventory("ADSmode", 1)
			"####" "#" 0 A_JumpIf (momZ > 0, "KickInAir")
			"####" "#" 0 A_JumpIf (momZ < 0, "KickInAir")
			"####" "#" 0 A_JumpIf((Abs(VelY) < 1) && (Abs(VelX) < 1), 2)
			"####" "#" 0 A_JumpIfInventory("IsCrouching", 1, "SlideAttack")
			"####" "#" 0 A_JumpIfInventory("PowerStrength", 1, "DoKickWithBerserk")
			"####" "#" 0 A_PlaySound("KICK")
			"####" "#" 0 SetPlayerProperty(0, 1, 0)
			TNT1 A 5
			K2CK A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			KICK A 0
			"####" BCD 1
			"####" A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
			"####" H 3 
			"####" IGF 1
			"####" "#" 0 SetPlayerProperty(0, 0, 0)
			"####" EDCBA 1 A_JumpIfInventory("Kicking", 1, "KickRight")
			TNT1 A 0 A_JumpIfInventory("Kicking", 1, "KickRight")
			Goto ReadyLoop
			
		DoKickWithBerserk:
			TNT1 A 0 A_PlaySound("KICK")
			TNT1 A 5
			K2CK A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			KICK A 0
			"####" BCD 1
			"####" A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
			"####" H 3
			"####" IGF 1
			"####" ED 1
			"####" CBA 1 A_JumpIfInventory("Kicking", 1, "KickRight")
			TNT1 A 0 A_JumpIfInventory("Kicking", 1, "KickRight")
			Goto ReadyLoop
			
		KickRight: // 15 tic
			TNT1 A 0 A_GunFlash("RightKickFlash")
			K1K2 A 0 A_JumpIfInventory("IsPaladin", 1, 3)
			K2K2 A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			KIK2 A 0 
			"####" "#" 0 A_TakeInventory("Kicking", 1)
			"####" ABC 1
			"####" A 0 A_PlaySound("KICK")
			"####" A 0 
			"####" A 0 A_SetPitch(pitch-9)
			"####" A 0 A_SetAngle(angle+9)
			"####" A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
			"####" D 1
			"####" A 0 A_SetPitch(pitch+2)
			"####" A 0 A_SetAngle(angle-2)
			"####" D 1
			"####" A 0 A_SetPitch(pitch+2)
			"####" A 0 A_SetAngle(angle-2)
			"####" E 1 
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle-1)
			"####" E 1
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle-1)
			"####" C 1 A_JumpIfInventory("Kicking", 1, "KickInAir")
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle-1)
			"####" B 2 A_JumpIfInventory("Kicking", 1, "KickInAir")
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle-1)
			"####" A 2 A_JumpIfInventory("Kicking", 1, "KickInAir")
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle-1)
			"####" A 2 A_JumpIfInventory("Kicking", 1, "KickInAir")
			"####" A 1 A_JumpIfInventory("Kicking", 1, "KickInAir")
			TNT1 A 1
			Goto ReadyLoop
			
		KickInAir: // 18 tics
			TNT1 A 0 A_GunFlash("KickInAirFlash")
			TNT1 A 0 A_TakeInventory("Kicking", 1)
			K2CK J 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			KICK J 1
			"####" A 0 A_JumpIfInventory("PowerStrength", 1, "KickInAirWithBerserk")
			"####" A 0 A_PlaySound("KICK")
			"####" A 0 A_Recoil(-15)
			"####" JKLMN 1
			"####" A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
			"####" O 3
			"####" PQ 2
			"####" RS 1
			"####" T 1 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			"####" A 2 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			"####" A 1 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			Goto ReadyLoop
			
		KickInAirWithBerserk: //18 tics
			K2CK J 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			KICK J 0
			"####" A 0 A_PlaySound("KICK")
			"####" A 0 A_Recoil(-15)
			"####" JKLMN 1
			"####" A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
			"####" O 3
			"####" PQ 2
			"####" RS 1
			"####" T 1 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			"####" A 2 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			"####" A 1 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			Goto ReadyLoop
			
		LeftFinishingKick: // 11 tics
			TNT1 A 0 A_GunFlash("LeftKickFlash")
			K2K3 A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			KIK3 A 0
			"####" "#" 0 A_TakeInventory("Kicking", 1)
			"####" A 0 A_Recoil(-10)
			"####" ABC 1
			"####" A 0 A_PlaySound("KICK")
			"####" A 0 A_SetPitch(pitch-9)
			"####" A 0 A_SetAngle(angle-9)
			"####" D 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
			"####" A 0 A_SetPitch(pitch+2)
			"####" A 0 A_SetAngle(angle+3)
			"####" E 1
			"####" A 0 A_SetPitch(pitch+2)
			"####" A 0 A_SetAngle(angle+3)
			"####" F 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle+3)
			"####" G 1 
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle+2)
			"####" H 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle+2)
			"####" I 1
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle+1)
			"####" J 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
			"####" A 0 A_SetPitch(pitch+1)
			"####" A 0 A_SetAngle(angle+1)
			"####" K 1
			Goto ReadyLoop
			
		SlideAttack:
			TNT1 A 0 A_GunFlash("SlideKickFlashStart")
			TNT1 A 0 SetPlayerProperty(0, 1, 0)
			KICK A 0 A_Takeinventory("Kicking", 1)
			TNT1 A 0 A_PlaySound("KICK")
			TNT1 A 0 A_Recoil(-16)
			TNT1 A 0 A_PlaySound("SlideKickStart", 5)
			S2DK A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			SLDK A 1
			"####" ABC 1
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" E 1
			"####" A 0 A_Recoil(-14)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-12)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-8)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-6)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-4)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-4)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-3)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-3)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-3)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-2)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-1)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-1)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			Goto FinishSlide
			
			"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
			"####" A 0 A_Recoil (-2)
			"####" A 0 A_SetPItch(10)
			"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
			"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
			"####" A 0 A_TakeInventory("KickHasHit", 1)
			Goto FinishSlide
			
		FinishSlide:  //10 tic
			TNT1 A 0 A_Takeinventory("Kicking",1)
			TNT1 A 0 A_GunFlash("SlideKickFlashEnd")
			TNT1 A 0 A_PlaySound("SlideKickStop", 5)
			S2DK H 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			SLDK H 0
			"####" A 0 SetPlayerProperty(0, 0, 0)		
			"####" HD 2 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			"####" A 0 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			"####" CBA 2 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
			"####" A 0 A_Takeinventory("Kicking", 1)
			Goto ReadyLoop	
			
		FinishSlideHitwall:	
			TNT1 A 0 A_GunFlash("SlideKickFlashEnd")
			S2DK H 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			SLDK H 1
			"####" A 0 A_Stop
			"####" HDCBA 2
			"####" A 0 A_TAkeInventory("KickHasHit", 1)
			"####" A 0 A_Takeinventory("Kicking",1)
			"####" A 0 SetPlayerProperty(0, 0, 0)
			Goto ReadyLoop
			
		TossGrenade:
			TNT1 A 0 A_JumpIfInventory("IsSorcerer", 1, "CheckTypeWall")
			TNT1 A 0 A_TakeInventory("TossGrenade", 1)
			TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 3)
			TNT1 A 0 A_Print("No Grenades Left.")
			Goto ReadyLoop
			TNT1 A 0 A_GunFlash("GrenadeFlash")
			TNT1 A 10
			GRTH ABCD 1
			TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
			TNT1 A 0 A_Giveinventory("Punching",1)
			TNT1 A 0 A_Giveinventory("GoSpecial",1)
			TNT1 A 0 A_PLaySound ("GRNPIN")
			GRTH EEFG 1
			TNT1 A 0 A_PLaySound ("GRNTOSS")
			GRTH HI 1
			TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
			TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2, 2), 0, 0, 0, 0, 0)
			TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
			GRTH JKLM 1
			Goto Ready
		
		CheckTypeWall:
			TNT1 A 0 A_JumpIfInventory("QuickFireSpellSelected", 1, "InitializeFirewall")
			//TNT1 A 0 A_JumpIfInventory("QuickLightningSpellSelected",1,"QuickLightningSpell")
			TNT1 A 0 A_JumpIfInventory("QuickFrostSpellSelected", 1, "InitializeIcewall")
			//TNT1 A 0 A_TakeInventory("TossGrenade", 1)
			//Goto ReadyLoop
			InitializeFirewall:
			TNT1 A 0 A_GunFlash("GrenadeFlash")
			TNT1 A 10
			CONG EFGHI 2 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
			TNT1 A 0 A_PlaySound("Sorcerer/SpellCastLarge", CHAN_VOICE) 		
			TNT1 A 0 A_FireCustomMissile ("Firewall", 0, 1, 0, 0) //("SuperHammerFX", 0, 1, 0, 0)
			TNT1 A 0 A_SetPitch(-4.0 + pitch)
			TNT1 A 0 A_TakeInventory("BrutalBlueMana", 200)
			TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
			CONE BA 3 A_SetPitch(+2.0 + pitch)
			CONE AAAAA 3 A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
			TNT1 A 0 A_TakeInventory("TossGrenade", 1)
			Goto Ready
		
		InitializeIcewall:
			TNT1 A 0 A_PlaySound("Cryomancy/Draw",6)
			TNT1 A 0 A_PlaySound("ICEBRK1")
			F5CH S 5 BRIGHT A_gunflash("FlashWarp")
			F9CH KJ 2 BRIGHT A_TakeInventory("BrutalGreenMana",10)
			F9CH IH 2 BRIGHT A_TakeInventory("BrutalGreenMana",10)
			TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
			TNT1 A 0 A_PlaySound("Sorcerer/SpellCast", CHAN_VOICE) 		
			TNT1 A 0 A_PlaySound("Cryomancy/IceballCast", 1) 
			F9CH G 2 BRIGHT A_FireCustomMissile("IceWall", random(-2,2), 0, -1, 0, 0, random(-2,2))
			F9CH D 1 BRIGHT A_Recoil(15)
			TNT1 A 0 A_SetPitch(-18.0 + pitch)
			QKFR GHIIJJ 4 A_SetPitch(+2.0 + pitch)
			CONE BAA 7
			TNT1 A 0 A_TakeInventory("TossGrenade", 1)
			Goto Ready
		
		Taunt:
			TNT1 A 0 A_JumpIfInventory("IsSorcerer", 1, "TauntBlinkTeleport")
			PISR AB 2
			PI2G E 1 Offset(-20, 32)
			PI2G E 1 Offset(-10, 32)
			TNT1 A 0 A_GunFlash("TauntFlash")
			TNT1 A 0 A_Takeinventory("Zoomed", 1)
			TNT1 A 0 A_Takeinventory("ZoomHold", 1)
			TNT1 A 0 A_ZoomFactor(1.0)
			TNT1 A 0 A_Takeinventory("Taunting", 1)
			FUCK F 1
			TNT1 A 0 A_FireCustomMissile("Taunter", 0, 0, -1, 0)
			TNT1 A 0 A_FireCustomMissile("Taunter", -9, 0, -1, 0)
			TNT1 A 0 A_FireCustomMissile("Taunter", 9, 0, -1, 0)
			FUCK G 1 A_PlaySound("FUCK", 2)
			FUCK HI 1 A_AlertMonsters
			FUCK J 15
			FUCK IHGF 1
			PI2G E 1 Offset(-10, 32)
			PI2G E 1 Offset(-20, 32)
			PISR B 2 Offset(1, 32)
			PISR A 2 Offset(1, 32)
			Goto ReadyLoop
			
		TauntBlinkTeleport: //17 tic
			TNT1 A 0 A_TakeInventory("Taunting",1)
			TNT1 A 0 A_GunFlash("GrenadeFlash")
			BlinkageHold:
			TNT1 A 8
			TNT1 A 0 A_ChangeFlag("SPECTRAL", 1)
			TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
			MLNG ABCD 2 BRIGHT
			TNT1 A 0 A_SpawnItemEx("BlinkTargetMissile", 36*Cos(pitch), 0, 30-36*Sin(pitch), 100*Cos(pitch), 0, -100*Sin(pitch))
			BlinkageHold2:
			MLNG E 1
			TNT1 A 0 A_ChangeVelocity(100*Cos(pitch), 0, -100*Sin(pitch),CVF_REPLACE|CVF_RELATIVE)
			MLNG FG 2 BRIGHT A_ZoomFactor(0.70, ZOOM_INSTANT)
			MLNG HI 2 BRIGHT A_ZoomFactor(1.00)
			MLNG H 0 A_ChangeVelocity(0, 0, 0, CVF_REPLACE)
			TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
			TNT1 A 0 A_ChangeFlag("SPECTRAL", 0)
			Goto Ready
			
		Quickspell:	
			TNT1 A 0 A_TakeInventory("Quickspell", 1)
			TNT1 A 0 A_JumpIfInventory("IsSorcerer", 1, 3)
			TNT1 A 0 A_Print("You are not a mage !")
			TNT1 A 0 A_Jump(256, "ReadyLoop")
			TNT1 A 0 A_Takeinventory("Zoomed",1)
			TNT1 A 0 A_Takeinventory("PowerLightAmp",1)
			TNT1 A 0 A_Takeinventory("ADSmode",1)
			TNT1 A 0 A_JumpIfInventory("QuickFireSpellSelected",1,"QuickFireSpell")
			TNT1 A 0 A_JumpIfInventory("QuickLightningSpellSelected",1,"QuickLightningSpell")
			TNT1 A 0 A_JumpIfInventory("QuickFrostSpellSelected",1,"QuickFrostSpell")
			Goto QuickFireSpell
			
		QuickFireSpell: 
			TNT1 A 0 A_GunFlash("SpellFlash")
			TNT1 A 2
			FOSP AB 1 
			TNT1 A 0 A_AlertMonsters 
			TNT1 A 0 A_PlaySound("IGNITE")
			FOSP CCDD 1 
			FOSP EEFFGG 1 BRIGHT 
			FOSP GGHH 1 BRIGHT
			TNT1 A 0 A_FireCustomMissile("MageFireBall", 0, 1, 0, -10)
			TNT1 A 0 A_SetPitch(-6.0 + pitch)
			TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
			FOSP IJ 1 BRIGHT A_SetPitch(+2 + pitch)
			FOSP KCBBAA 1 A_SetPitch(+0.5 + pitch)
			TNT1 A 8
			Goto ReadyLoop
			
		QuickLightningSpell: 
			TNT1 A 0 A_GunFlash("SpellFlash")
			LGQS AB 1 
			TNT1 A 0 A_AlertMonsters 
			TNT1 A 0 A_PlaySound("TPortalZap", CHAN_WEAPON, 2) 
			LGQS CCDD 1 
			LGQS EFGHIJ 1 BRIGHT 
			LGQS KL 1 BRIGHT A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
			TNT1 A 0 A_RailAttack(90, 10, 0, none, "9F 9F FF", RGF_SILENT | RGF_FULLBRIGHT, 25, "LightningPuff", 0, 0, 600, 5,0.001,5.0,"StormTrailParticle",-15) 
			TNT1 A 0 A_SetPitch(-6.0 + pitch)
			TNT1 A 0 A_FireCustomMissile("LightningMissile3", 0, 0, 0,-10)
			TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
			LGQS MNO 1 BRIGHT A_SetPitch(+2 + pitch)
			LGQS PQR 1 BRIGHT A_SetPitch(+0.5 + pitch)
			LGQS FEDCBA 1
			TNT1 A 8
			Goto ReadyLoop
			
		QuickFrostSpell:	
			TNT1 A 0 A_GunFlash("SpellFlash")
			TNT1 A 2
			TNT1 A 0 A_Giveinventory("HasFreezerWeapon",1)
			IS1F AABB 1
			IS1F CCDD 1
			IS1F KLF 1
			IS1F MNO 1 BRIGHT
			IS1F A 0 A_Giveinventory("HasFreezerWeapon",1)
			IS1F G 1 BRIGHT A_FireCustomMissile ("BlueFlareSpawn",0,0,0,0)
			IS1F A 0 A_PlaySound("ICESHA", 1)
			IS1F H 1 BRIGHT 
			TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",0,0,0,0)
			IS1F I 1 BRIGHT A_FireCustomMissile ("FrostShard",random(-5,5),0,0,random(-12,12)) 
			TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",0,0,0,0)
			IS1F J 1 BRIGHT A_FireCustomMissile ("FrostShard",random(-5,5),0,0,random(-12,12))
			TNT1 A 0 A_Recoil(3)
			TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",0,0,0,0)
			IS1F K 1 BRIGHT A_FireCustomMissile ("FrostShard",random(-5,5),0,0,random(-12,12))
			TNT1 A 0 A_Takeinventory("HasFreezerWeapon",1)
			IS1F DCBAA 1
			TNT1 A 8
			Goto ReadyLoop
		
		NoAmmo:
			TNT1 A 0 A_JumpIfInventory("Clip1", 1, 2)
			Goto NoAmmo2
			TNT1 A 0 A_JumpIfInventory("Zoomed", 1, "NoAmmoInZoom")
			MPIS A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			PIST A 0
			"####" "#" 0 A_JumpIfInventory("noautoreload", 1, 2)
			Goto Reload
			"####" "#" 0 A_JumpIfInventory("turboreload", 1, "RefillTo15")
			"####" B 3 A_PlaySound("weapons/empty", 4)
			"####" "#" 0 A_ZoomFactor(1.0)
			Goto ReadyLoop
			
		NoAmmoInZoom:
			TNT1 A 0 A_JumpIfInventory("Clip1", 1, 2)
			Goto NoAmmo2
			BESZ A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERZ A 0
			"####" "#" 0 A_JumpIfInventory("noautoreload", 1, 2)
			Goto Reload
			"####" "#" 0 A_JumpIfInventory("turboreload", 1, "RefillTo15")
			"####" D 3 A_PlaySound("weapons/empty", 4)
			Goto ReadyLoop
			
		NoAmmo2:
			MPIS A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			PIST A 0
			"####" "#" 0 A_JumpIfInventory("Zoomed", 1, "NoAmmoStaticInZoom")
			"####" "#" 0 A_JumpIfInventory("Kicking", 1, "DoKick")	
			"####" "#" 0 A_JumpIfInventory("Taunting", 1, "Taunt")	
			"####" "#" 0 A_JumpIfInventory("Reloading", 1, "Reload")	
			"####" "#" 0 A_JumpIfInventory("TossGrenade", 1, "TossGrenade")	
			"####" "#" 0 A_JumpIfInventory("Quickspell", 1, "Quickspell")
			"####" "#" 0 A_JumpIfInventory("StartDualWield", 1, "DualWield")
			"####" B 3 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOSECONDARY)
			Loop
			
		NoAmmoStaticInZoom:
			BESZ A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERZ A 0
			"####" "#" 0 A_JumpIfInventory("Kicking", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("Taunting", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("Reloading", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("TossGrenade", 1, "ExitFromZoom")	
			"####" "#" 0 A_JumpIfInventory("Quickspell", 1, "ExitFromZoom")
			"####" "#" 0 A_JumpIfInventory("StartDualWield", 1, "ExitFromZoom")
			"####" G 3 A_WeaponReady(WRF_ALLOWRELOAD)
			Goto NoAmmo2
		
		DualWield:
			"####" F 0 A_TakeInventory("StartDualWield",1)
			"####" F 0 A_JumpIfInventory("IsSorcerer", 1, "Enchanting")
			"####" F 0 A_JumpIfInventory("DualPistols", 1, "GetDual")
			"####" F 0 A_Print("You must have two identical weapons to dual wield.")
			Goto ReadyLoop
			
		NoDual:
			"####" F 0 A_Print("You are a mage, you can't dual wield!")
			Goto ReadyLoop
			
		GetDual:	
			PIST F 0
			PIST F 0 A_ZoomFactor(1.0)
			PIST F 0 A_SelectWeapon("DualPistols")
			Goto ReadyLoop
			
		Enchanting:
			TNT1 A 0 A_JumpIfInventory("QuickFireSpellSelected", 1, "FireEnchant")
			TNT1 A 0 A_JumpIfInventory("QuickLightningSpellSelected", 1, "LightningEnchant")
			TNT1 A 0 A_JumpIfInventory("QuickFrostSpellSelected", 1, "FrostEnchant")
			FireEnchant:
			"####" F 0 A_Print("Now your Pistol is charged with power of Pyromancy")
			TNT1 A 0 A_GiveInventory("FireEnchantedBrutalPistol", 1)
			TNT1 A 0 A_TakeInventory("FrostEnchantedBrutalPistol", 1)
			TNT1 A 0 A_TakeInventory("LightningEnchantedBrutalPistol", 1)
			Goto ReadyLoop
			
		LightningEnchant:
			"####" F 0 A_Print("Now your Pistol is charged with power of Stormacasting")
			TNT1 A 0 A_GiveInventory("LightningEnchantedBrutalPistol", 1)
			TNT1 A 0 A_TakeInventory("FrostEnchantedBrutalPistol", 1)
			TNT1 A 0 A_TakeInventory("FireEnchantedBrutalPistol", 1)
			Goto ReadyLoop

		FrostEnchant:
			"####" F 0 A_Print("Now your Pistol is charged with power of Cryomancy")
			TNT1 A 0 A_GiveInventory("FrostEnchantedBrutalPistol", 1)
			TNT1 A 0 A_TakeInventory("LightningEnchantedBrutalPistol", 1)
			TNT1 A 0 A_TakeInventory("FireEnchantedBrutalPistol", 1)
			Goto ReadyLoop
			
		TauntFlash:
			PI2G E 23
			Stop
			
		GrenadeFlash:
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" ABCDE 1
			Stop
			
		KickFlash:
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" ABCDE 1
			TNT1 A 9
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" EDCBA 1
			Stop
			
		KickInAirFlash: //19 tics
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" ABCDE 1
			TNT1 A 9
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" EDCBA 1
			Stop
			
		RightKickFlash: //16 tics
			TNT1 A 11
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" EDCBA 1
			Stop
			
		LeftKickFlash: // 11 tics
			TNT1 A 6
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" EDCBA 1
			Stop
			
		SlideKickFlashStart: //27
			TNT1 A 22
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" EDCBA 1
			Stop
			
		SlideKickFlashEnd: //10 tic
			TNT1 A 6
			MPID A 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			BERG A 0
			"####" EDCBA 1
			Stop
			
		SpellFlash:
			MPIR STTUUUUVVVVVVVVVVVVVVVVVVVVVUUUTTS 1
			stop
	}
}
Actor HasFiredWithZoom : TokenBase {}
Actor FireEnchantedBrutalPistol : TokenBase {}
Actor LightningEnchantedBrutalPistol : TokenBase {}
Actor FrostEnchantedBrutalPistol : TokenBase {}